#include <bits/stdc++.h>

using namespace std;

const int mod = 1e9+7;
const int MAXN = 1<<17;

int ok,s[20],x,y,z,n,ful;
int top,f[2][MAXN],g[2],ans;

void add(int &x,int y){x=x+y;if(x>=mod) x-=mod;}

int getstu(int stu,int num){
	int newstu = 0;
	for(int i = 0;i + num < x+y+z;i++){
		if(stu >> i & 1){
			if(s[i + num - 1] - s[i] > 0) continue;
			newstu |= 1<<(i + num);
		}
	}
	if(num <= x) newstu |= 1<<(num-1);
	return newstu;
}

int main (){
	scanf("%d %d %d %d",&n,&x,&y,&z);
	s[x-1] = s[x+y-1] = s[x+y+z-1] = 1;
	for(int i = 1;i < x+y+z;i++) s[i] = s[i-1] + s[i];
	ok = 1<<(x+y+z-1); ful = 1<<(x+y+z);
	f[0][0] = 1;
	for(int o = 0,i = 1;i <= n;i++,o = o^1){
		memset(f[o^1],0,sizeof(f[o^1]));
		g[o^1] = g[o] * 10ll % mod;
		for(int stu = 0;stu < ful;stu++)
			if(f[o][stu]){
				for(int j = 1;j <= 10;j++){
					int ns = getstu(stu,j);
					if(ns & ok) add(g[o^1],f[o][stu]);
					else add(f[o^1][ns],f[o][stu]);
				}
			}
		if(i == n) ans = g[o^1];
	}
	printf("%d\n",ans);
	return 0;
}
